const {
  defineConfig
} = require('@vue/cli-service')
const path = require('path')
const port = 8087
module.exports = defineConfig({
  transpileDependencies: true,
  devServer: {
    port,
    hot: true, //热更新
    https: false,
    host: 'localhost',
    // host: '127.0.0.1',
    open: true,
    proxy: {
      '/api': {
        // target: 'http://1.116.64.64:5004/', // 生产
        target: 'http://localhost:3000/',  // 开发
        changeOrigin: true,
        // 服务器再本地需要解开如下代码，取出/api，生产环境访问远程需要注释下面代码
        pathRewrite: {
          '^/api': '/'
        },
      },
    },
  },
  configureWebpack: {
    resolve: {
      fallback: {
        path: require.resolve('path-browserify')
      }
    }
  }

})